<!--
 * @Descripttion: 
 * @Copyright: 武汉一一零七科技有限公司©版权所有
 * @Link: www.s1107.com
 * @Contact: QQ:2487937004
 * @LastEditors: cbing
 * @LastEditTime: 2020-05-01 18:40:18
 -->
<script>
	var pnum = {$pnum};
	{if condition="(isset($filter)) AND ($filter)"}
	var filter = {$filter};
	{/if}
	{if condition="!isset($search) && !isset($cate_id)"}
	var search = 0;
	var cate_id = 0;
	var goUrl = "/{$Request.module}/goods/lst/filter/"+filter+".html?page="+pnum;
	{elseif condition="isset($search) && $search" /}
	var search = {$search};
	var cate_id = 0;
	var goUrl = "/{$Request.module}/goods/search.html?page="+pnum;
	{elseif condition="isset($cate_id) && $cate_id" /}
	var cate_id = {$cate_id};
	var search = 0;
	var goUrl = "/{$Request.module}/goods/catelist/cate_id/"+cate_id+"/filter/"+filter+".html?page="+pnum;
	{/if}
</script>                           
                        
                        <table class="table table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th style="width:5%"><input type="checkbox" id="checkAll"/></th>
                                    <th style="width:5%">ID</th>
                                    <th style="width:20%">商品标题</th>
                                    <th style="width:8%">缩略图</th>
                                    <th style="width:10%">所属分类</th>
                                    <th style="width:8%">市场价格</th>
                                    <th style="width:8%">销售价格</th>
                                    <th style="width:5%">上架</th>
                                    <!--<th style="width:5%">是否直播间商品</th>-->
                                    <th style="width:15%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {if condition="$list->isEmpty() == false"}
                                {foreach name="list" item="v"} 
                                <tr>
                                    <td><input type="checkbox" id="goods_id" class="text_id" name="id[]" value="{$v.id}" /></td>
                                    <td>{$v.id}</td>
                                    <td>
                                            {if($v.integral_cate == 1)}
                                            <div class="integral-box">
                                                积分商品：积分抵扣金额
                                            </div>
                                            {elseif($v.integral_cate == 2)/}
                                            <div class="integral-box">
                                                积分商品：积分+商品金额
                                            </div>
                                            {elseif($v.integral_cate == 3)/}
                                            <div class="integral-box">
                                                积分商品：积分换购
                                            </div>
                                            {/if}
                                        </div>
                                        {$v.goods_name}
                                    </td>   
                                    <td>
                                        <img src="{$v.thumb_url}" width="80px" height="80px"/>
                                    </td>                                   
                                    <td>{$v.cate_name}</td>
                                    <td>{$v.market_price}元</td>
                                    <td>{$v.shop_price}元</td>
                                    <td>
                                    {if condition="$v['onsale'] eq 1"}
                                    <button class="btn btn-primary btn-xs" type="button" onclick="changeTableVal({$v.id},'onsale',this);"><i class="fa fa-check"></i></button>
                                    {elseif condition="$v['onsale'] eq 0" /}
                                    <button class="btn btn-danger btn-xs" type="button" onclick="changeTableVal({$v.id},'onsale',this);"><i class="fa fa-times"></i></button>
                                    {/if}
                                    </td>
                                    <!--<td>-->
                                    <!--{if condition="$v['is_live'] eq 1"}-->
                                    <!--<button class="btn btn-primary btn-xs" type="button" onclick="changeTableVal({$v.id},'is_live',this);"><i class="fa fa-check"></i></button>-->
                                    <!--{elseif condition="$v['is_live'] eq 0" /}-->
                                    <!--<button class="btn btn-danger btn-xs" type="button" onclick="changeTableVal({$v.id},'is_live',this);"><i class="fa fa-times"></i></button>-->
                                    <!--{/if}-->
                                    <!--</td>-->
                                    <td>
                                        <button type="button" class="btn btn-primary btn-xs" onclick="editgoods({$v.id},this);"><i class="fa fa-pencil"></i>&nbsp;编辑</button>
                                        <button type="button" class="btn btn-danger btn-xs" onclick="recycle({$v.id},this);"><i class="fa fa-close"></i>&nbsp;删除</button>
                                    </td>
                                </tr>
                                {/foreach}
                                {else/}
                                <tr><td colspan="9" style="text-align:center; font-size:14px;">没有找到相关数据</td></tr>
                                {/if}
                            </tbody>
                        </table>
                        <div class="row"><div class="pagination" style="float:right; margin-right:20px;">{$page}</div></div>